package com.nts.visionworks.business.streamevent.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * StreamEvent generated by hbm2java
 */
@Entity
@Table(name = "stream_event", catalog = "visionworks")
public class StreamEvent implements java.io.Serializable
{

	private Long eventId;
	private String eventName;
	private String description;
	private Set<StreamSynapse> streamSynapses = new HashSet<StreamSynapse>(0);

	public StreamEvent()
	{
	}

	public StreamEvent(String eventName)
	{
		this.eventName = eventName;
	}

	public StreamEvent(String eventName, String description,
			Set<StreamSynapse> streamSynapses)
	{
		this.eventName = eventName;
		this.description = description;
		this.streamSynapses = streamSynapses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "EventId", unique = true, nullable = false)
	public Long getEventId()
	{
		return this.eventId;
	}

	public void setEventId(Long eventId)
	{
		this.eventId = eventId;
	}

	@NotNull(message = "validation.streamEvent.eventName.notNull")
	@Size(message = "validation.streamEvent.eventName.length", max = 100, min = 1)
	@Column(name = "EventName", nullable = false, length = 100)
	public String getEventName()
	{
		return this.eventName;
	}

	public void setEventName(String eventName)
	{
		this.eventName = eventName;
	}

	@Max(message = "validation.streamEvent.description.max", value = 2000)
	@Column(name = "Description", length = 2000)
	public String getDescription()
	{
		return this.description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "streamEvent")
	public Set<StreamSynapse> getStreamSynapses()
	{
		return this.streamSynapses;
	}

	public void setStreamSynapses(Set<StreamSynapse> streamSynapses)
	{
		this.streamSynapses = streamSynapses;
	}

}
